package com.qdlc.p2p.biz.executer.impl;

import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import com.qdlc.p2p.biz.executer.BaseExecuter;
import com.qdlc.p2p.biz.service.ExperienceTenderService;
import com.qdlc.p2p.common.constant.Global;
import com.qdlc.p2p.common.util.BeanUtil;

/**
 * 体验券还款业务处理
 * @author xxx
 * @version 2.0
 * @date 2015年4月27日 下午6:50:03
 */
@Service
@Scope(value=ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class ExperienceRepayExecuter extends BaseExecuter {

	@Override
	public void extend() {
		Object obj = Global.getTransfer().get("borrowId");
		Object obj_period = Global.getTransfer().get("period");
		if(obj != null && obj_period != null){
			long borrowId = Long.parseLong(obj.toString());
			byte period = Byte.parseByte(obj_period.toString());
			ExperienceTenderService experienceTenderService = (ExperienceTenderService)BeanUtil.getBean("experienceTenderService");
			experienceTenderService.experienceRepay(borrowId, period);
		}
	}

}
